package com.person.android.utils;

/**
 * @autor zhaokang.
 * @time on 2015/12/20.
 */
public class ByteUtils {

    public static int bytes2int(byte[] bytes) {
        return (bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00) | ((bytes[2] << 24) >>> 8) | (bytes[3] << 24);
    }

    public static short bytes2short(byte[] bytes) {
        return (short) ((bytes[0] & 0xff) | ((bytes[1] << 8)));
    }
}
